package behaviorType.command;

import java.util.Vector;

public class Judger {
    private Vector<ICommand> commands = new Vector<ICommand>();

    public void addCommand(ICommand command) {
        commands.add(command);
    }

    public void removeCommand(ICommand command) {
        int i = commands.indexOf(command);
        if (i >= 0) {
            commands.remove(command);
        }
    }

    public void execute() {
        for (ICommand command : commands) {
            command.execute();
        }
    }
}
